<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>回复</title>
<link href="/css/base.css" type="text/css" rel="stylesheet" />
<link href="/css/manage.css" type="text/css" rel="stylesheet" />
<link href="/css/layout.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/js/jquery.default.js"></script>
<script type="text/javascript" src="/js/jquery.validate.js"></script>
<script type="text/javascript" src="/js/xiaodian.js"></script>
<!--[if ie]><link href="/css/ie.css" type="text/css" rel="stylesheet"><![endif]-->
<style>
.comment_list .face_box li  {
margin: 0 8px 0 0;
}
</style>
</head>

<body>
   <?php $this->load->view('head');?>
    <div class="w100p mt25 mb25">
    	<div class="w903 mg clearfix">
        	<div class="layout_left">
            	<div class="box_s5">
                    <div class="content1">
                    	<div class="c_pd_s1">
                            <!-- comment -->
                            <ul class="comment_list lr_box">
                            	<li>
                                	<div class="l_box"><a href="#"><img width="62" height="62" src="<?php echo site_url($comment['avatar']) ?>" class="block" /></a></div>
		                            <div class="r_box">
		                                <p class="info">                                        	
		                                    <a href="#"><?php echo replaceExpress($comment['content'])?></a>
		                                </p>
		                                <div class="comment_else">
		                                    <div class="comment_nums">
		                                        <a href="###" onclick="support(this);"><span>支持 [<label class="sup_num"><?php echo $comment['support']?></label>]</span></a>
		                                        &nbsp;<a href="javascript:;" class="c_reply"><span>回复 </span></a><a target="_blank" href="<?php echo site_url('replylist/'.$comment['id'].'/4')?>">[<?php echo $comment['replys']?>]</a>
		                                    </div>
		                                    <span>来自：<a href="#" class="author"><?php echo $comment['username']?></a>&nbsp;<?php echo date('Y-m-d',$comment['createtime']);?>  </span>
		                                </div>
		                            </div>
                                    <div class="clear"></div>
                                    <div class="com_comment" style="display:none;">
	
		                                <div class="main_comment">
		                                    <ul class="face_box">
		                                        <li express="[大笑]"><img src="../../images/others/face_1.png" /></li>
				                                <li express="[惊讶]"><img src="../../images/others/face_2.png" /></li>
				                                <li express="[害羞]"><img src="../../images/others/face_3.png" /></li>
				                                <li express="[哈切]"><img src="../../images/others/face_4.png" /></li>
				                                <li express="[白眼]"><img src="../../images/others/face_5.png" /></li>
				                                <li express="[大哭]"><img src="../../images/others/face_6.png" /></li>
				                                <li express="[偷笑]"><img src="../../images/others/face_7.png" /></li>
				                                <li express="[示爱]"><img src="../../images/others/face_8.png" /></li>
		                                    </ul>
		                                        <table class="com_form issue_comment">
		                                            <tbody>
			                                            <tr>
			                                                <td><textarea class=" def_ta_s5" name="info" style="width: 531px;"></textarea><br class="clear"><div class="validate_v" /></td>
			                                            </tr>
			                                            <tr>
			                                                <td class="tr"><input replyId="<?php echo $comment['id']?>" type="button" value="提交" class="def_btn_s9 mt5 submit reply_comment" /></td>
			                                            </tr>
		                                        	</tbody>
		                                        </table>
		                                </div>
		                            </div>
		                            <?php if (count($replyList) > 0):?>
		                            <div class="box_s7 ml5 mt15">
			                            <div class="b_head"></div>
		                            <?php foreach ($replyList as $reply):?>
		                            	
			                                <div class="content">
			                                	<ul class="feedback_list">
			                                    	<li>
			                                        	<div class="lr_box">
			                                            	<div class="l_box">
			                                                	<a href="<?php echo site_url('tamember?id='.$reply['memberId'])?>"><img src="<?php echo site_url($reply['avatar'])?>" width="64" height="64" /></a>
			                                                    <a href="<?php echo site_url('tamember?id='.$reply['memberId'])?>" class="name"><?php echo $reply['username']?></a>
			                                                </div>
			                                                <div class="r_box">
			                                                	<p class="info"><?php echo replaceExpress($reply['content'])?></p>
			                                                </div>
			                                            </div>
			                                        </li>
			                                    </ul>
			                                </div>
			                               
		                            <?php endforeach;?>
		                            	 <div class="b_foot"></div>
		                                <i class="icon_arrow_s4"></i>
		                            </div>
		                            <?php endif;?>
		                            
                                </li>
                                
                            </ul>
                            <!-- comment--end-->
                            <!-- fanye -->
                            <div class="fanye mt10">
                            <?php echo $this->pagination->create_links()?>
                             </div>
                            <!-- fanye--end-->
                        </div>
                    </div>
                </div>
            </div>
            <?php if(isset($store) && $store != null):?>
            	<div class="layout_right">
	                <div class="box_s6">
	                	<div class="b_head"></div>
	                    <div class="content">
	                    	<div class="c_pd_s2">
	                    		<a href="<?php echo site_url('store?id='.$store['id'])?>" class="block"><img src="<?php echo site_url($store['photo'])?>" width="295" height="187" class="block" /></a>
	                            <div class="relative_info_box">
	                            	<p>地址：<?php echo $store['address']?></p>
	                                <p>Add：<?php echo $store['eaddress']?> </p>
	                                <!--<p>类别：<i class="clrblue"><?php echo $storeType['value']?></i></p>
	                                --><p>风格：<?php echo $store['style']?></p>
	                                <p>营业时间：<?php echo $store['bustime']?></p>
	                                <p>电话：<?php echo $store['phone']?></p>
	                            </div>
	                        </div>
	                    </div>
	                    <div class="b_foot"></div>
	                </div>
	            </div>
            <?php endif;?>
            <?php if(isset($street) && $street != null):?>
            	<div class="layout_right">
	                <div class="box_s6">
	                	<div class="b_head"></div>
	                    <div class="content">
	                    	<div class="c_pd_s2">
	                    		<a href="<?php echo site_url('street?id='.$street['id'])?>" class="block"><img src="<?php echo site_url($street['logo'])?>" width="295" class="block" /></a>
	                            <div class="relative_info_box">
	                            	<p>名称：<?php echo $street['name']?></p>
	                                <p>Name：<?php echo $street['ename']?> </p>
	                            </div>
	                        </div>
	                    </div>
	                    <div class="b_foot"></div>
	                </div>
	            </div>
            <?php endif;?>
            
            <div class="clear"></div>
        </div>
    </div>
    
   <?php $this->load->view('foot')?>
   <script type="text/javascript">
	$(function(){
		$.defaults.commentReply("<?php echo site_url('member/tologin')?>?gourl=<?php echo site_url('replylist/'.$comment['id'].'/'.$type)?>");
	   $(".reply_comment").click(function(){
			
			var content = $(this).parent().parent().parent().find("textarea[name='info']").val();
			if(content == null || content ==''){
				alert('评论不能为空');
				return ;
			}

			$.post("<?php echo site_url('member/replycomment')?>",{
				type:'<?php echo $type?>',
				belongId:$(this).attr('replyId'),
				content:content
			},function(data){
					var ret = $.parseJSON(data);
					if(ret.success == 'true'){
						window.location.reload();
					}else{
						alert(ret.msg);
					}
					
				});
		});

	})
	
	function support(obj){
		if(xiaodian.checkLogin()){
			$.post('<?php echo site_url('member/support')?>',{
					belongId:'<?php echo $comment['id']?>',
					type:'<?php echo $type?>'
				},function(data){
					var ret = $.parseJSON(data);
					if(ret.success=='true'){
						var oldNum = $(obj).find(".sup_num").text();
						$(obj).find(".sup_num").text(parseInt(oldNum)+1);
					}else{
						alert(ret.msg);
					}
				})
			
		}else{
			window.location.href="<?php echo site_url('member/tologin')?>?gourl=<?php echo site_url('replylist/'.$comment['id'].'/'.$type)?>";
		}
	}
   
   </script>
</body>
</html>
